﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
using System.Data.Common;
using System.Collections;


using Htss.Platform.Data;
namespace DreamBox.DAL
{
    public class PSelect
    {
        /// <summary>
        /// 通用查询(返回DataTable)
        /// </summary>
        /// <param name="tablename"></param>
        /// <param name="field"></param>
        /// <param name="where"></param>
        /// <returns></returns>
        public DataTable Select(string tablename,string field,string where)
        {
            DbProc g = new DbProc("dbox_PubSelect");
            g.SetFields("@tablename",tablename);
            g.SetFields("@field",field);
            g.SetFields("@where",where);
            return g.ExecDataSet().Tables[0];
        }
        public DbTable SelectForReader(string tablename, string field, string where)
        {
            DbProc g = new DbProc("dbox_PubSelect");
            g.SetFields("@tablename", tablename);
            g.SetFields("@field", field);
            g.SetFields("@where", where);
            return g.ExecForReader();
        }
    }
}
